home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / prog / gnu-c / etc / profile (.txt) < prev    next >
Microsoft Windows Help File Content  |  1994-07-24  |  6KB  |  198 lines

  1. # NAME:
  2. #    profile - global initialization for sh,ksh
  3. # DESCRIPTION:
  4. #    This file is processed during login by /bin/sh
  5. #    and /bin/ksh.  It is used to setup the default user
  6. #    environment.  It is processed with root privs.
  7. # SEE ALSO:
  8. #    $HOME/.profile
  9. #    /etc/ksh.kshrc
  10. # RCSid:
  11. #    $Id: profile,v 1.3 1992/05/03 08:28:27 sjg Exp $
  12. #    @(#)Copyright (c) 1991 Simon J. Gerraty
  13. #    This file is provided in the hope that it will
  14. #    be of use.  There is absolutely NO WARRANTY.
  15. #    Permission to copy, redistribute or otherwise
  16. #    use this file is hereby granted provided that 
  17. #    the above copyright notice and this notice are
  18. #    left intact. 
  19. case "$_INIT_" in
  20. *env*) ;;
  21. *)    # do these once
  22.     _INIT_="$_INIT_"env
  23.     export _INIT_
  24.     # sys_config.sh should set ARCH,OS,C,N,HOSTNAME,uname
  25.     # we use these in lots of scripts...
  26.     [ -f /etc/sys_config.sh ] && . /etc/sys_config.sh
  27.     # pick one of the following for the default umask
  28.     # umask 002    # relaxed    -rwxrwxr-x
  29.     umask 022    # cautious    -rwxr-xr-x
  30.     # umask 027    # uptight    -rwxr-x---
  31.     # umask 077    # paranoid    -rwx------
  32.     # you can override the default umask
  33.     # for specific groups later...
  34.     if [ -d /local ]; then
  35.         LOCAL=/local
  36.     else
  37.         LOCAL=/usr/local
  38.     # set system specific things,
  39.     # eg. set PATH,MANPATH 
  40.     # override default ulimit if desired.
  41.     # defult ulmit is unlimited on SunOS
  42.     # and 4Mb for most System V
  43.     case $OS in
  44.     AmigaDOS)
  45.         PATH=/c:/sys/rexxc:/gcc:/usr/bin:$PATH:.
  46.         MANPATH=/usr/share/man
  47.         LOGNAME=root
  48.         USER=root
  49.         defterm=amiga    
  50.     SunOS)
  51.         # On sun's /bin -> /usr/bin so leave it out!
  52.         PATH=.:/usr/bin:/usr/ucb:/usr/5bin
  53.         MANPATH=/usr/man
  54.         defterm=vt220
  55.     SCO-UNIX)
  56.         PATH=.:/bin:/usr/bin:/usr/lbin:/usr/dbin:/usr/ldbin
  57.         MANPATH=/usr/man
  58.         defterm=ansi
  59.     B.O.S.)
  60.         PATH=.:/bin:/usr/bin
  61.         if [ -d /usr/ucb ]; then
  62.             PATH=$PATH:/usr/ucb
  63.         MANPATH=/usr/catman
  64.         defterm=vt220
  65.         SRC_COMPAT=_SYSV
  66.         export SRC_COMPAT
  67.         PATH=.:/bin:/usr/bin
  68.         if [ -d /usr/ucb ]; then
  69.             PATH=$PATH:/usr/ucb
  70.         MANPATH=/usr/catman
  71.         defterm=vt220
  72.     esac
  73.     if [ -d ${LOCAL}/bin ]; then
  74.         PATH=$PATH:${LOCAL}/bin
  75.     if [ -d $HOME/bin -a "$HOME" != / ]; then
  76.         PATH=$PATH:$HOME/bin
  77.     if [ -d ${LOCAL}/man ]; then
  78.         MANPATH=$MANPATH:${LOCAL}/man
  79.     # make sure these are set at least once
  80. #    LOGNAME=${LOGNAME:-`logname`}
  81. #    USER=${USER:-$LOGNAME}
  82.     # this is adapted from my whoami.sh
  83.     # we expect id to produce output like:
  84.     # uid=100(sjg) gid=10(staff) groups=10(staff),...
  85.     S='('
  86.     E=')'
  87. #    GROUP=`id | cut -d= -f3 | \
  88. #        sed -e "s;^[^${S}][^${S}]*${S}\([^${E}][^${E}]*\)${E}.*$;\1;"`
  89.     GROUP=other
  90.     # set some group specific defaults
  91.     case "$GROUP" in
  92.     staff)    # staff deal with things that non-staff 
  93.         # have no business looking at
  94.         umask 027
  95.     extern)    # we put external accounts in group "extern"
  96.         # give them as much privacy as we can...
  97.         umask 077
  98.         ulimit 16384    # 8Mb file limit
  99.         TMOUT=600    # idle timeout
  100.     esac
  101.     unset S E GROUP
  102.     export LOCAL TTY PATH LOGNAME USER
  103.     if [ -t 1 ]; then
  104. #        TTY=`tty`
  105. #        TTY=`basename $TTY`
  106.         TTY=console
  107.         ORGANIZATION="Philippe Brand phb#telesys-innov.fr"
  108. #        COPYRIGHT="Copyright (c) `date +19%y` $ORGANIZATION"
  109.         COPYRIGHT="Copyright (c) 1993 $ORGANIZATION"
  110.         export ORGANIZATION COPYRIGHT
  111.         # set up some env variables
  112.         MAIL=/usr/spool/mail/$USER
  113.         MAILPATH=/usr/spool/mail/$USER:/etc/motd
  114.         EMACSDIR=${LOCAL}/lib/emacs
  115.         PAGER=${PAGER:-more}
  116.         export MAIL EMACSDIR MANPATH MAILPATH PAGER
  117.         EDITOR=emacs
  118.         FCEDIT=${EDITOR}    
  119.         PROMPT="<$LOGNAME@$HOSTNAME>$ "
  120.         PUBDIR=/usr/spool/uucppublic
  121.         export PUBDIR 
  122.         [ -f /etc/profile.TeX ] && . /etc/profile.TeX
  123.     else
  124.         TTY=none
  125.     # test (and setup if we are Korn shell)
  126.     if [ "$RANDOM" != "$RANDOM" ]; then
  127.         # we are Korn shell
  128.         SHELL=/bin/ksh
  129.         ENV=${HOME%/}/.kshrc
  130.         PROMPT="<$LOGNAME@$HOSTNAME:!>$ "
  131.         export HISTSIZE HISTFILE ENV
  132.         CDPATH=.:$HOME
  133.         if [ "$TMOUT" ]; then
  134.             typeset -r TMOUT
  135.     else
  136.         SHELL=/bin/sh
  137.     PS1=$PROMPT
  138.     export SHELL PS1 EDITOR PATH PROMPT HOSTNAME CDPATH FCEDIT
  139. # login time initialization
  140. case "$_INIT_" in
  141. *log*) ;;
  142. *)    _INIT_="$_INIT_"log
  143. #    if [ $TTY != none -a "$0" != "-su" -a "$LOGNAME" = "`logname`" -a ! -f ~/.hushlogin ]
  144.     if [ $TTY != none -a "$0" != "-su" -a ! -f ~/.hushlogin ]
  145.     then
  146. #        case $TERM in
  147. #        network|unknown|dialup|"") 
  148. #            echo $N "Enter terminal type [$defterm]: $C" 1>&2
  149. #            read tmpterm
  150. #            TERM=${tmpterm:-$defterm}
  151. #            ;;
  152. #        esac
  153.         # set up desired tty modes
  154. #        stty intr '^c'
  155. #        case $TERM in
  156. #        wy50)    stty erase '^h';;
  157. #        *)    stty erase '^?';;
  158. #        esac
  159.         # welcome first time users
  160.         [ -r ${LOCAL}/etc/1stlogin.ann -a ! -f $HOME/... ] && \
  161.             . ${LOCAL}/etc/1stlogin.ann
  162.         # not all of the following are appropriate at all sites
  163.         # Sun's don't need to cat /etc/motd for instance
  164.         case "$OS" in
  165.         SunOS)    ;;
  166.         SCO-UNIX)    
  167.             [ -s /etc/motd ] && cat /etc/motd
  168.             [ -x /usr/bin/mail -a -s "$MAIL" ] && 
  169.                 echo "You have mail."
  170.             [ -x /usr/bin/news ] && /usr/bin/news -n
  171.             ;;
  172.             [ -s /etc/motd ] && cat /etc/motd
  173.             if [ -x /usr/bin/mailx ]; then
  174.                if mailx -e; then
  175.                 echo "You have mail."
  176.                 # show the the headers, this might
  177.                 # be better done in .profile so they
  178.                 # can override it.
  179. #                mailx -H
  180.               fi
  181.             fi
  182.             [ -x /usr/bin/news ] && /usr/bin/news -n
  183.             ;;
  184.         esac
  185.         [ -x /usr/games/fortune ] && /usr/games/fortune -a
  186.         # remind folk who turned on reply.pl to turn it off.
  187.         if [ -f $HOME/.forward ]; then
  188.             echo "Your mail is being forwarded to:"
  189.             cat $HOME/.forward
  190.             if [ -f $HOME/.recording ]; then
  191.                 echo "Perhaps you should run \"reply.pl off\""
  192.             fi
  193.     unset tmpterm defterm C N
  194.     TERM=${TERM:-unknown}
  195.     export TERM TTY
  196. # Handle X-terminals if necessary
  197. [ -f /etc/profile.X11 ] && . /etc/profile.X11
  198.